﻿using Castle.DynamicProxy;

namespace Vasuleg.UIDrive
{
    public static class ProxyGeneratorUtils
    {
        private static readonly ProxyGenerator _proxyGenerator = new();

        public static ProxyGenerator GetGlobalProxyGenerator()
        {
            return _proxyGenerator;
        }

        public static T CreateClassProxy<T>(params IInterceptor[] interceptors) where T : class
        {
            return _proxyGenerator.CreateClassProxy<T>(interceptors);
        }

        public static T CreateClassProxyWithTarget<T>(T target, params IInterceptor[] interceptors) where T : class
        {
            return _proxyGenerator.CreateClassProxyWithTarget(target, interceptors);
        }
    }
}